package cn.itcast.Thread.Thread;

class Flag extends Thread{
	
	boolean flag=true;
	
	@Override
	public void run() {
		int i=0;
		while(flag){
			i++;
			System.out.println(this.getName()+" : "+i);
		}
	}
}

public class Demo07_flag {
	public static void main(String[] args) {
		Flag f=new Flag();
		f.start();
		f.setPriority(5);
		Thread.currentThread().setPriority(5);
		for(int i=0;i<100;i++){
			System.out.println(Thread.currentThread().getName()+" : "+i);
			if(i==80){
				f.flag=false;
			}
				
		}
	}
}	
